import request from './request'

export function querySummaryReport(data: any) {
  if (data.dateTime) {
    const startTime = data.dateTime[0]
    const endTime = data.dateTime[1]
    data.startTime = startTime
    data.endTime = endTime
  }

  return request({
    url: '/summaryReport/query',
    method: 'post',
    data: data,
  })
}

export function getWeeklySummary(data: any) {
  return request({
    url: '/summaryReport/getWeeklySummary',
    method: 'post',
    data: data,
    responseType: 'blob',
  })
}

export function getAnnualSummary(data: any) {
  return request({
    url: '/summaryReport/getAnnualSummary',
    method: 'post',
    data: data,
    responseType: 'blob',
  })
}
